3.102 \(\int \frac{\sqrt{2}-x^2}{1-\sqrt{2} x^2+x^4} \, dx\)

Optimal. Leaf size=160 \[ -\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (x^2-\sqrt{2+\sqrt{2}} x+1\right )+\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (x^2+\sqrt{2+\sqrt{2}} x+1\right )-\frac{\tan ^{-1}\left (\frac{\sqrt{2+\sqrt{2}}-2 x}{\sqrt{2-\sqrt{2}}}\right )}{2 \sqrt{2+\sqrt{2}}}+\frac{\tan ^{-1}\left (\frac{2 x+\sqrt{2+\sqrt{2}}}{\sqrt{2-\sqrt{2}}}\right )}{2 \sqrt{2+\sqrt{2}}} \]

[Out]

-ArcTan[(Sqrt[2 + Sqrt[2]] - 2*x)/Sqrt[2 - Sqrt[2]]]/(2*Sqrt[2 + Sqrt[2]]) + ArcTan[(Sqrt[2 + Sqrt[2]] + 2*x)/
Sqrt[2 - Sqrt[2]]]/(2*Sqrt[2 + Sqrt[2]]) - (Sqrt[1 + 1/Sqrt[2]]*Log[1 - Sqrt[2 + Sqrt[2]]*x + x^2])/4 + (Sqrt[
1 + 1/Sqrt[2]]*Log[1 + Sqrt[2 + Sqrt[2]]*x + x^2])/4

________________________________________________________________________________________

Rubi [A]  time = 0.145837, antiderivative size = 160, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {1169, 634, 618, 204, 628} \[ -\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (x^2-\sqrt{2+\sqrt{2}} x+1\right )+\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (x^2+\sqrt{2+\sqrt{2}} x+1\right )-\frac{\tan ^{-1}\left (\frac{\sqrt{2+\sqrt{2}}-2 x}{\sqrt{2-\sqrt{2}}}\right )}{2 \sqrt{2+\sqrt{2}}}+\frac{\tan ^{-1}\left (\frac{2 x+\sqrt{2+\sqrt{2}}}{\sqrt{2-\sqrt{2}}}\right )}{2 \sqrt{2+\sqrt{2}}} \]

Antiderivative was successfully verified.

[In]

Int[(Sqrt[2] - x^2)/(1 - Sqrt[2]*x^2 + x^4),x]

[Out]

-ArcTan[(Sqrt[2 + Sqrt[2]] - 2*x)/Sqrt[2 - Sqrt[2]]]/(2*Sqrt[2 + Sqrt[2]]) + ArcTan[(Sqrt[2 + Sqrt[2]] + 2*x)/
Sqrt[2 - Sqrt[2]]]/(2*Sqrt[2 + Sqrt[2]]) - (Sqrt[1 + 1/Sqrt[2]]*Log[1 - Sqrt[2 + Sqrt[2]]*x + x^2])/4 + (Sqrt[
1 + 1/Sqrt[2]]*Log[1 + Sqrt[2 + Sqrt[2]]*x + x^2])/4

Rule 1169

Int[((d_) + (e_.)*(x_)^2)/((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[a/c, 2]}, With[{r =
Rt[2*q - b/c, 2]}, Dist[1/(2*c*q*r), Int[(d*r - (d - e*q)*x)/(q - r*x + x^2), x], x] + Dist[1/(2*c*q*r), Int[(
d*r + (d - e*q)*x)/(q + r*x + x^2), x], x]]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[c*d^2
- b*d*e + a*e^2, 0] && NegQ[b^2 - 4*a*c]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

\begin{align*} \int \frac{\sqrt{2}-x^2}{1-\sqrt{2} x^2+x^4} \, dx &=\frac{\int \frac{\sqrt{2 \left (2+\sqrt{2}\right )}-\left (1+\sqrt{2}\right ) x}{1-\sqrt{2+\sqrt{2}} x+x^2} \, dx}{2 \sqrt{2+\sqrt{2}}}+\frac{\int \frac{\sqrt{2 \left (2+\sqrt{2}\right )}+\left (1+\sqrt{2}\right ) x}{1+\sqrt{2+\sqrt{2}} x+x^2} \, dx}{2 \sqrt{2+\sqrt{2}}}\\ &=\frac{1}{4} \sqrt{3-2 \sqrt{2}} \int \frac{1}{1-\sqrt{2+\sqrt{2}} x+x^2} \, dx+\frac{1}{4} \sqrt{3-2 \sqrt{2}} \int \frac{1}{1+\sqrt{2+\sqrt{2}} x+x^2} \, dx+\frac{\left (-1-\sqrt{2}\right ) \int \frac{-\sqrt{2+\sqrt{2}}+2 x}{1-\sqrt{2+\sqrt{2}} x+x^2} \, dx}{4 \sqrt{2+\sqrt{2}}}+\frac{\left (1+\sqrt{2}\right ) \int \frac{\sqrt{2+\sqrt{2}}+2 x}{1+\sqrt{2+\sqrt{2}} x+x^2} \, dx}{4 \sqrt{2+\sqrt{2}}}\\ &=-\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (1-\sqrt{2+\sqrt{2}} x+x^2\right )+\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (1+\sqrt{2+\sqrt{2}} x+x^2\right )-\frac{1}{2} \sqrt{3-2 \sqrt{2}} \operatorname{Subst}\left (\int \frac{1}{-2+\sqrt{2}-x^2} \, dx,x,-\sqrt{2+\sqrt{2}}+2 x\right )-\frac{1}{2} \sqrt{3-2 \sqrt{2}} \operatorname{Subst}\left (\int \frac{1}{-2+\sqrt{2}-x^2} \, dx,x,\sqrt{2+\sqrt{2}}+2 x\right )\\ &=-\frac{1}{2} \sqrt{\frac{1}{2} \left (2-\sqrt{2}\right )} \tan ^{-1}\left (\frac{\sqrt{2+\sqrt{2}}-2 x}{\sqrt{2-\sqrt{2}}}\right )+\frac{1}{2} \sqrt{\frac{1}{2} \left (2-\sqrt{2}\right )} \tan ^{-1}\left (\frac{\sqrt{2+\sqrt{2}}+2 x}{\sqrt{2-\sqrt{2}}}\right )-\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (1-\sqrt{2+\sqrt{2}} x+x^2\right )+\frac{1}{4} \sqrt{1+\frac{1}{\sqrt{2}}} \log \left (1+\sqrt{2+\sqrt{2}} x+x^2\right )\\ \end{align*}

Mathematica [C]  time = 0.0449579, size = 53, normalized size = 0.33 \[ \frac{\sqrt{-1-i} \tan ^{-1}\left (\frac{\sqrt [4]{2} x}{\sqrt{-1-i}}\right )+\sqrt{-1+i} \tan ^{-1}\left (\frac{\sqrt [4]{2} x}{\sqrt{-1+i}}\right )}{2^{3/4}} \]

Antiderivative was successfully verified.

[In]

Integrate[(Sqrt[2] - x^2)/(1 - Sqrt[2]*x^2 + x^4),x]

[Out]

(Sqrt[-1 - I]*ArcTan[(2^(1/4)*x)/Sqrt[-1 - I]] + Sqrt[-1 + I]*ArcTan[(2^(1/4)*x)/Sqrt[-1 + I]])/2^(3/4)

________________________________________________________________________________________

Maple [A]  time = 0.104, size = 199, normalized size = 1.2 \begin{align*}{\frac{\sqrt{2}\sqrt{2+\sqrt{2}}\ln \left ( 1+{x}^{2}+x\sqrt{2+\sqrt{2}} \right ) }{8}}+{\frac{\sqrt{2}}{2\,\sqrt{2-\sqrt{2}}}\arctan \left ({\frac{2\,x+\sqrt{2+\sqrt{2}}}{\sqrt{2-\sqrt{2}}}} \right ) }-{\frac{1}{2\,\sqrt{2-\sqrt{2}}}\arctan \left ({\frac{2\,x+\sqrt{2+\sqrt{2}}}{\sqrt{2-\sqrt{2}}}} \right ) }-{\frac{\sqrt{2}\sqrt{2+\sqrt{2}}\ln \left ( 1+{x}^{2}-x\sqrt{2+\sqrt{2}} \right ) }{8}}+{\frac{\sqrt{2}}{2\,\sqrt{2-\sqrt{2}}}\arctan \left ({\frac{2\,x-\sqrt{2+\sqrt{2}}}{\sqrt{2-\sqrt{2}}}} \right ) }-{\frac{1}{2\,\sqrt{2-\sqrt{2}}}\arctan \left ({\frac{2\,x-\sqrt{2+\sqrt{2}}}{\sqrt{2-\sqrt{2}}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-x^2+2^(1/2))/(1+x^4-x^2*2^(1/2)),x)

[Out]

1/8*2^(1/2)*(2+2^(1/2))^(1/2)*ln(1+x^2+x*(2+2^(1/2))^(1/2))+1/2/(2-2^(1/2))^(1/2)*arctan((2*x+(2+2^(1/2))^(1/2
))/(2-2^(1/2))^(1/2))*2^(1/2)-1/2/(2-2^(1/2))^(1/2)*arctan((2*x+(2+2^(1/2))^(1/2))/(2-2^(1/2))^(1/2))-1/8*2^(1
/2)*(2+2^(1/2))^(1/2)*ln(1+x^2-x*(2+2^(1/2))^(1/2))+1/2/(2-2^(1/2))^(1/2)*arctan((2*x-(2+2^(1/2))^(1/2))/(2-2^
(1/2))^(1/2))*2^(1/2)-1/2/(2-2^(1/2))^(1/2)*arctan((2*x-(2+2^(1/2))^(1/2))/(2-2^(1/2))^(1/2))

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} -\int \frac{x^{2} - \sqrt{2}}{x^{4} - \sqrt{2} x^{2} + 1}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2+2^(1/2))/(1+x^4-x^2*2^(1/2)),x, algorithm="maxima")

[Out]

-integrate((x^2 - sqrt(2))/(x^4 - sqrt(2)*x^2 + 1), x)

________________________________________________________________________________________

Fricas [C]  time = 1.46472, size = 387, normalized size = 2.42 \begin{align*} \frac{1}{4} \, \sqrt{\left (i + 1\right ) \, \sqrt{2}} \log \left (x + \frac{1}{2} \, \sqrt{2} \sqrt{\left (i + 1\right ) \, \sqrt{2}}\right ) - \frac{1}{4} \, \sqrt{\left (i + 1\right ) \, \sqrt{2}} \log \left (x - \frac{1}{2} \, \sqrt{2} \sqrt{\left (i + 1\right ) \, \sqrt{2}}\right ) + \frac{1}{4} \, \sqrt{-\left (i - 1\right ) \, \sqrt{2}} \log \left (x + \frac{1}{2} \, \sqrt{2} \sqrt{-\left (i - 1\right ) \, \sqrt{2}}\right ) - \frac{1}{4} \, \sqrt{-\left (i - 1\right ) \, \sqrt{2}} \log \left (x - \frac{1}{2} \, \sqrt{2} \sqrt{-\left (i - 1\right ) \, \sqrt{2}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2+2^(1/2))/(1+x^4-x^2*2^(1/2)),x, algorithm="fricas")

[Out]

1/4*sqrt((I + 1)*sqrt(2))*log(x + 1/2*sqrt(2)*sqrt((I + 1)*sqrt(2))) - 1/4*sqrt((I + 1)*sqrt(2))*log(x - 1/2*s
qrt(2)*sqrt((I + 1)*sqrt(2))) + 1/4*sqrt(-(I - 1)*sqrt(2))*log(x + 1/2*sqrt(2)*sqrt(-(I - 1)*sqrt(2))) - 1/4*s
qrt(-(I - 1)*sqrt(2))*log(x - 1/2*sqrt(2)*sqrt(-(I - 1)*sqrt(2)))

________________________________________________________________________________________

Sympy [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: PolynomialError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x**2+2**(1/2))/(1+x**4-x**2*2**(1/2)),x)

[Out]

Exception raised: PolynomialError

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int -\frac{x^{2} - \sqrt{2}}{x^{4} - \sqrt{2} x^{2} + 1}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-x^2+2^(1/2))/(1+x^4-x^2*2^(1/2)),x, algorithm="giac")

[Out]

integrate(-(x^2 - sqrt(2))/(x^4 - sqrt(2)*x^2 + 1), x)